2.12 [LibraryClasses] Section
The EDK II INF [LibraryClasses]
section is used to list the names of the
library classes that are required, or optionally required by a component. A
library class instance, as specified in the DSC file, will be linked into the
component. The Library Class' Recommended Instance path must be a package
relative path.
Library classes listed in architectural sections must not be listed in common
[LibraryClasses]
sections. The architectural section modifier is used as a
restriction to mask items from architectures that are not applicable.
This section uses one of the following section definitions:
[LibraryClasses]
[LibraryClasses.common]
[LibraryClasses.IA32]
[LibraryClasses.X64]
[LibraryClasses.EBC]
The format for entries in this section is:
LibraryClassName1 [ | FeatureFlagExpression ]
When a FeatureFlagExpression
is present, if the expression evaluates to
TRUE
, then the build tools must ensure that a library class instance has been
specified when building this module. If the expression evaluates to FALSE
,
then the EDK II build tools must ignore the entry.
LibraryClassName2
LibraryClassName3 ## $(WORKSPACE)/Path/To/RecommendedLibInstanceName.inf
The comment, using the double hash "##" marks, specifies the module developer's recommended library instance. This is information that the platform integrator can use to help select a library instance for a given library class during a build. The package developer may also provide a recommended library instance. The defined library instance (defined in a DSC file,) that satisfies a Library Class will be added to the LIBS definition in the output makefile:
LIBS = $(LIBS) $(LIB_DIR)/{LibInstanceName}
Note: The above is not the name of the INF file, but the name of the library file that was generated during the instance's compilation. Refer to the EDK II DSC File Specification for rules to select library class instances.
Note: For binary driver or application modules, this is a list of the library instances in comments that were used to create the binary (.efi) executable file.
The following is an example of the library class section.
[LibraryClasses]
MemoryAllocationLib
BaseMemoryLib
PeiServicesTablePointerLib
CustomDecompressLib
TianoDecompressLib UefiDecompressLib
EdkPeCoffLoaderLib
CacheMaintenanceLib
ReportStatusCodeLib
PeiServicesLib
PerformanceLib
HobLib
BaseLib
PeimEntryPoint
DebugLib